<template>
	<div class="top">
		<tabswitch :list="tabs" @change="changeTab" :defaultValue="'待审核'" />
		<div style="height: 25px"></div>
		<item :list="items" />
	</div>
</template>
<script setup>
import {computed, onMounted, ref} from "vue";
import item from "@/views/home/item.vue";
import tabswitch from './tabswitch.vue'
import tool from "@/utils/tool";
const tabs = ref([
  {text: '待审核'},
  {text: '已审核'},
  {text: '有欠款'},
  {text: '已删除'},
])
const model = ref({
  billType: '待审核',
  range: '近一周',
})
const topData = ref([])

const items = computed(() => {
  return topData.value
})
onMounted(() => {
  getList()
})
const getList = () => {
  tool.post('home/top', model.value, true).then(ret => {
    if(ret.stat) {
      topData.value = ret.data
    }
  })
}
const changeTab = (val) => {
  model.value = val
  getList()
}

</script>

<style scoped lang="scss">
.top {

}
</style>